package com.lu.sb210219.exception;


import com.lu.sb210219.enums.ApiResultCodeEnum;

public class ApiException extends RuntimeException {

    private ApiResultCodeEnum apiResultCodeEnum;

    public ApiException(ApiResultCodeEnum apiResultCodeEnum) {
        super(apiResultCodeEnum.getMessage());
        this.apiResultCodeEnum = apiResultCodeEnum;
    }

    public ApiResultCodeEnum getApiResultCodeEnum() {
        return this.apiResultCodeEnum;
    }

    public Integer getCode() {
        return this.apiResultCodeEnum.getCode();
    }

    @Override
    public String getMessage() {
        return this.apiResultCodeEnum.getMessage();
    }
}
